/************************************************************
 * 扩展GridPanel的获取id方法
 ************************************************************/

Ext.apply(Ext.grid.GridPanel.prototype, {
    getRecordId: function() {
        if (this.getSelectionModel().hasSelection()) {
          var ids = new Array();
          var records = this.getSelectionModel().getSelections();
          for(var i = 0, len = records.length; i < len; i ++) {
            ids[ids.length] = records[i].id;
          }
          return ids;
        } else {
          return null;
        }
    },
    getRecords: function() {
        if (this.getSelectionModel().hasSelection()) {     
          return this.getSelectionModel().getSelections();    
        } else {
          return null;
        }
    }
});


function renderLast(value, p, r){
	var pathName = window.location.pathname;
    return String.format('<b><a href="http://extjs.com/forum/showthread.php?t={2}" target="_blank">{0}</a></b>', value.dateFormat('M j, Y, g:i a'), r.data['lastposter']);
}
